var express = require('express');
var fs = require('fs');
var path = require('path');

//引入路由
var router = require('./routers/router.js');
var router_user = require('./routers/user.js');

var app = new  express();

//开放文件夹
app.use('/public', express.static(path.join(__dirname, 'public')));
app.use('/node_modules', express.static(path.join(__dirname, 'node_modules')));
app.use('/views', express.static(path.join(__dirname, 'views')));
//加载模板引擎
app.engine('html', require('express-art-template'));

//把路由挂载到app中
app.use(router);
app.use(router_user);




app.listen(3000,function(){
    console.log('server is running => http://localhost:3000');
});